#ifndef XKIT_H
#define XKIT_H

#include "losu.h"
#include "platform/platform.h"

#ifdef __linux__
    #define XKIT_OS_LINUX
#elif defined(_WIN32)
    #ifdef _WIN64
        #define XKIT_OS_WINDOWS 64
    #else
        #define XKIT_OS_WINDOWS 32
    #endif
#endif

static inline void *__xkit_malloc(size_t size) {
    return losu_platform_mem_realloc(NULL, size);
}

static inline void *__xkit_realloc(void *p, size_t size) {
    return losu_platform_mem_realloc(p, size);
}

static inline void __xkit_free(void *p) {
    losu_platform_mem_free(p);
}

static inline void __error_OutOfIndex(losu_vm_t vm) {
    vm_error(vm, "xkit error: Index out of range");
}

static inline void __error_TooFewArguments(losu_vm_t vm) {
    vm_error(vm, "xkit error: Too few arguments for this function");
}

static inline void __error_UnavailableObject(losu_vm_t vm) {
    vm_error(vm, "xkit error: This object is unavailable, maybe you modified the key attributes");
}

static inline void __error_UnsupportedPlatforms(losu_vm_t vm) {
    vm_error(vm, "xkit error: This functions is not supported on this Platform");
}


#endif
